package com.pysrc.base.config;

import com.pysrc.base.interceptor.FirstInterceptor;
import com.pysrc.base.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName:
 * @Auther L.Chen
 * @CreateDate
 * @Description 在这里配置拦截器
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private SysUserService userService;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new FirstInterceptor(userService)).addPathPatterns("/**");
    }

}
